package yelmor.comm100.util;

import java.util.Random;

/**
 * Created by yel on 4/28/16.
 */
public class CodeGrenrator {
  public static String generateSiteCode() {
    String siteCode = "";
    Random random = new Random();
    for (int i = 0; i < 8; i++) {
      int n = random.nextInt(30);
      if (n < 26) {
        siteCode += (char)('a' + n);
      } else {
        siteCode += randomDigit();
      }
    }
    return siteCode;
  }

  public static int randomDigit() {
    Random random = new Random();
    return random.nextInt(10);
  }
}
